package com.thank.validator;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * description: 自定义校验注解
 *
 * @author thank
 * 2018/2/19 1:59
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MyCustomerValidator.class)
public @interface MyCustomerValid {

    /**
     * 需要加入以下三个属性
     * 可以参考{@link NotBlank}
     */

    String message();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
